<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/taglib/cw" prefix="CW"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title></title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!--系统css  -->
<link href="<%=basePath%>css/en/edit.css" rel="stylesheet" type="text/css">
<!--通用js  -->
<script type="text/javascript" src="<%=basePath%>js/commons/common_edit.js"></script>
<script type="text/javascript">
	$(document).ready(function() {
		$("#radio").buttonset();
		$('#updateRoleForm').validate({
			messages : {
				"rolemanager.RoleNumber" : {
					required : '<s:text name="tip_is_not_null"></s:text>',
					rangelength : '<s:text name="tip_rangelength"><s:param>1</s:param><s:param>64</s:param></s:text>'
				},
			},
			rules : {
				"rolemanager.RoleNumber" : {
					required : true,
					rangelength : [ 1, 11 ]
				},
			},
		});
	});
	function __back(){
	 //设置请求的url 
		var _url = "<%=basePath%>/role/findAllRoles.action";
		location.href=_url;
	}
	function __submit(){
	   if($("#updateRoleForm").valid()){
		    $("#loadingdiv").show();
			document.updateRoleForm.action="<%=basePath%>role/ModifyRole.action";
			document.updateRoleForm.submit();
		}
	}
</script>
</head>

<body>
<form action="role/ModifyRole.action" name="updateRoleForm" id="updateRoleForm" method="post" target="mainFrame">
	<jsp:include page="../../../common/loadingPage.jsp" />
	<div class="pageheader" >
		<!-- 页面标题 -->
		<div class="pagetitle">
			角色修改
		</div>
		<!-- 操作按钮 -->
		<div class="pageheadercontent">
			<div class="toolbar">
				<div class="toolbarright">
					<input class="okbtn" name="_submit" type="button" value="OK" onclick="__submit()">
					<input class="calbtn" name="_back" type="button" value="Cancel" onclick="__back()">
				</div>
			</div>
		</div>
	</div>
	<div class="writetblbox" style="width: 700px">
		<table class="writetbl" style="width: 100%">
			<tr>
				<th>角色名称：</th>
				<td><input name="rolemanager.RoleName" type="text" readonly="readonly" value="<s:property value="rolemanager.RoleName" />"></td>
				<th>角色排序号：</th>
				<td><input name="rolemanager.RoleNumber" type="text" value="<s:property value="rolemanager.RoleNumber" />">
				</td>
			</tr>
			<tr>
				<th>状态：</th>
				<td colspan="3">
					<div id="radio">
						<input type="radio" id="radio1" name="rolemanager.Status"  value="1"
							<s:if test="%{rolemanager.Status == 1}">checked="checked"</s:if>><label for="radio1" >启用</label> 
						<input type="radio" id="radio2" name="rolemanager.Status"  value="0"
							<s:if test="%{rolemanager.Status == 0}">checked="checked"</s:if>><label for="radio2">停用</label>
					</div>
				</td>
			</tr>
			<tr>
				<th>描述：</th>
				<td colspan="3"><textarea cols="20" name="rolemanager.RoleRemark" rows="4"><s:property value="rolemanager.RoleRemark" /></textarea>
				</td>
			</tr>
		</table>
	</div>
</form>
</body>
</html>
